<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/bootstrap.min.css"/>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/jedate.css"/>
		<link rel="stylesheet" type="text/css" href="../../../resource/fonts/iconfont.css"/>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/common.css"/>
		<style type="text/css">
			/*.erp-txt span{width: 100px;}*/
		</style>
	</head>
	<body>
		<div class="container-fluid">
			<div class="row mheader">
				<div class="col-xs-2 text-left"><a href="javascript:;" onclick="javascript:history.back(-1);"><span class="iconfont icon-fanhui"></span></a></div>
				<div class="col-xs-8"><h2>材料签收详情</h2></div>
				<div class="col-xs-2 text-right"> <a href="erp-delivery.html" id="qs">签收</a> </div>
			</div>
			<div class="row" id = "list">
				<!-- 头部 -->
				<dl class="erp-list erp-details" id="ttt">
				</dl>
				<!-- 详情 -->
				<dl class="erp-order" id="sss">
				</dl>

			</div>
		</div>
	</body>
</html>
<script src="https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script>
<script src="../../../resource/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../resource/js/style.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../resources/js/template-web.js" type="text/javascript" charset="utf-8"></script>
<script id="t" type="text/html">
	<dl class="erp-list erp-details">
		<dd>
			<div class="erp-txt visa-txt">
				<p><span>供料单号:</span>{{rm_code}}</p>
				<p><span class="sp">项目名称:</span><span class="divCon">{{proName}}</span></p>
				<p><span class="sp">供货单位:</span><span class="divCon">{{compName}}</span></p>
				<p><span class="sp">收货地址:</span><span class="divCon">{{r_adr}}</span></p>
				<p><span>签收状态:</span>{{validate}}</p>
				<p><span>审核状态:</span>{{state}}</p>
				<p class="QSR"><span>签收人:</span>{{recvName}}</p>
				<p class="QSOpinion"><span>签收意见:</span>{{recvName_Opinion}}</p>
			</div>
		</dd>
	</dl>
</script>
<script id="m_list" type="text/html">
	<dt>材料单</dt>
	{{each data as value i}}
		<dd>
			<p><span>材料名称:</span>{{value.mat_Name}}</p>
			<div class="order-li clearfix">
				<div class="col-xs-6"><span>材料规格:</span>{{value.mat_Spec}}</div>
				<div class="col-xs-6"><span>送料数量:</span>{{value.send_Num}}<span></span></div>
				<div class="col-xs-6"><span>计量单位:</span>{{value.mat_Bit}}</div>
				<div class="col-xs-6"><span>签收数量:</span>{{value.rm_Num}}<span></span></div>

			</div>
		</dd>
	{{/each}}
</script>
<script type="text/javascript">

	//获取列表页的内容
	var obj = sessionStorage.getItem("obj");
    obj = JSON.parse(obj);

    //传入id来进行渲染
    var html = template('t', obj);
    document.getElementById('ttt').innerHTML =  html;

    //按钮显示否
	if( obj.validate != "等待签收" ){
		$("#qs").remove();
	}

	//详情
    loadDetails();
    /**
	 * 	加载详情
     */
	function loadDetails() {
        gundong(function(){
            ajaxs('api/ctteam/matSignDetails.do',
                'post',
                {'rm_code':obj.rm_code,'p':getP()},
                function (data) {
                    console.log(data);
                    var d=data.data;
                    d[0].recvName?d[0].recvName=d[0].recvName:d[0].recvName='';
                    d[0].recvName_Opinion?d[0].recvName_Opinion=d[0].recvName_Opinion:d[0].recvName_Opinion='';
                    $('.QSR').html('<span>签收人:</span>'+d[0].recvName);
                    $('.QSOpinion').html('<span>签收意见:</span>'+d[0].recvName_Opinion);
                    //传入id来进行渲染
                    var html = template('m_list', data);
                    document.getElementById('sss').innerHTML =  html;
                });
        }());
    }

	//点击改变申请单高度
	$(document).ready(function(){
		  $(".more").click(function(){
		    $(this).siblings(".order-li").toggleClass("orderHeight");
		  });
	});
</script>











